Important: This notebook uses Plotly mostly to visualize data. Plotly charts won't be rendered in Githubs notebook viewer. So please use nbviewer instead to view the notebook, or your local installation after cloning the repo.
FIXME Link
import plotly.io as pio
pio.renderers.default = "notebook_connected"
import datetime
from opensea import ARTBLOCK_CONTRACT, retrieve_assets
from IPython.display import display # FIXME put elsewhere
FIDENZA_IDS = list(range(78000000, 78000998 + 1))
assets = retrieve_assets(token_ids=FIDENZA_IDS, contract=ARTBLOCK_CONTRACT)
print(datetime.datetime.now())
.................................................. -- All 999 assets retrieved. 2021-10-11 18:11:19.173898
import numpy as np
import pandas as pd
from helpers import turn_assets_into_df
df, traits = turn_assets_into_df(assets)
assert set(df.LPsymbol.unique()) == set(["ETH", "WETH", np.nan]), """
This sheet does not do currency conversion at the moment and therefore
assumes all prices are in (W)ETH. But there are more symbols in the input
data which would lead to apples being compared to ranges below. Aborting.
"""
print(f"{df[~df.Lastprice.isna()].shape[0] / df.shape[0]:.0%}")
61%
Note that this only takes into account the last sale of each piece.
import plotly.express as px
import plotly.graph_objects as go
import matplotlib.pyplot as plt
plt.rcParams["figure.figsize"] = (20, 8)
pd.plotting.register_matplotlib_converters()
fig = px.scatter(df, x="LPdate", y="Lastprice", hover_data=["Name", "Colors", "Probscore"])
fig.show()
fig = px.histogram(df, x="Lastprice")
fig.show()
for trait in traits:
display(
pd.DataFrame(df[trait].value_counts(normalize=False, sort=True, ascending=True)).transpose()
)
| Relaxed | Anything Goes | No Overlap | |
|---|---|---|---|
| Collision Check | 17 | 30 | 952 |
| Dark Lifestyle | Party Time | White on Cream | Luxe-Derived | Cool | Rose | Black | AM | White Mono | Baked | Politique | Rad | Golf Socks | Luxe | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Colors | 6 | 9 | 10 | 11 | 12 | 22 | 26 | 30 | 37 | 47 | 64 | 86 | 111 | 528 |
| Low | High AF | Medium | High | |
|---|---|---|---|---|
| Density | 49 | 68 | 277 | 605 |
| No | Yes | |
|---|---|---|
| Have Margin | 427 | 572 |
| Yes | No | |
|---|---|---|
| Outlined | 100 | 899 |
| Small | Jumbo XL | Medium | Micro-Uniform | Large | Uniform | Jumbo | |
|---|---|---|---|---|---|---|---|
| Scale | 14 | 30 | 35 | 38 | 181 | 189 | 512 |
| Sharp | Curved | |
|---|---|---|
| Shape Angles | 34 | 965 |
| Yes | No | |
|---|---|---|
| Soft Shapes | 150 | 849 |
| Yes | No | |
|---|---|---|
| Spiral | 35 | 964 |
| Yes | No | |
|---|---|---|
| Super Blocks | 241 | 758 |
| None | High | Low | Med | |
|---|---|---|---|---|
| Turbulence | 149 | 203 | 220 | 427 |
Note that the charts are interactive. You can zoom, hover, pan, etc. Zooming is especially important due to the outliers in the data so you can zoom in on the interesting parts.
for trait in traits:
fig = go.Figure()
for traitvariant in (
df.groupby(trait).median().sort_values("Lastprice", ascending=False).index
):
fig.add_trace(
go.Box(
y=df[df[trait] == traitvariant].Lastprice.values,
name=traitvariant,
boxpoints="all",
jitter=0.2,
whiskerwidth=0.2,
marker_size=2,
line_width=1,
)
)
fig.update_layout(title=trait)
fig.show()
FIXME observations
_ = pd.crosstab(df.Colors, df["Collision Check"]).plot(kind="bar", stacked=True)
The Probscore metric is simply the product of the probabilities of the different traits of a piece. There is currently not much value in that metric. While only the lowest probabilities are able to command the very high outlier prices, overall correlation between Probscore and Lastprice remains low:
fig = px.scatter(df, x="Probscore", y="Lastprice")
fig.show()
df[["Probscore", "Lastprice"]].corr()
| Probscore | Lastprice | |
|---|---|---|
| Probscore | 1.000000 | -0.032479 |
| Lastprice | -0.032479 | 1.000000 |
import plotly
plotly.offline.init_notebook_mode()